package de.bazinga.rotw.game;

import java.util.Enumeration;
import java.util.Hashtable;

public class TextCache {

	private static TextCache instance = null;
	
	private Hashtable<String,TextField> textfields = new Hashtable<String,TextField>();
	
	public TextCache() {
		
	}
	
	public static TextCache getInstance() {
		if(instance == null) instance = new TextCache();
		return instance;
	}
	
	
	public void addText(String name, TextField textfield) {
		textfields.put(name, textfield);
	}
	
	public TextField getTextfield(String name) {
		if(textfields.containsKey(name)) {
			return textfields.get(name);
		}
		return null;
	}
	
	public Enumeration<String> getKeys() {
		return textfields.keys();
	}
}
